<!--  -->
<template>
  <div class="invitation">
      <!-- <header-top title="我的邀请"></header-top> -->
      <div class="invitation-wrapper">
        <div class="invitation-card"><img src="../../assets/img/yaoqing.png" alt=""></div>
        <p>我的邀请码<span v-if="userInfo.token">{{userInfo.userInfo.accountNumber}}</span></p>
      </div>
  </div>
</template>

<script>
// import HeaderTop from '../HeaderTop/HeaderTop'
import {mapState} from 'vuex'
export default {
    data () {
        return {
            code:''
        };
    },

    // components: {
    //     HeaderTop
    // },

    computed: {
        ...mapState(['userInfo'])
    },
    created(){
        // if(this.userInfo.token){
        //     this.getCode()
        // }
    },
    methods: {
        async getCode(){
            const userId = this.userInfo.userInfo.id
            const token = this.userInfo.token
            console.log(userId,token)
            const result = await this.API.reqInvitation({userId,token})
            console.log(result)
            this.code = result.retData
        }
    }
}

</script>
<style lang='stylus' scoped>
@import "../../common/stylus/mixins.styl"
.invitation
    padding-bottom 0 !important
    width 100%
    height 100%
    background #fff
    .invitation-wrapper
        .invitation-card
            display flex
            justify-content center
            padding 40px 0
            img 
                height 240px
        p
            text-align center 
            color #FF3657
            font-weight 600
            span 
                font-weight 600
                margin-left 10px
</style>